<template>
  <div>
    <el-form :inline="true" :model="leaveForm" class="demo-form-inline">
      <el-form-item label="请假人">
        <el-input v-model="leaveForm.username" placeholder="请假人"></el-input>
      </el-form-item>
      <el-form-item label="请假天数">
        <el-input v-model="leaveForm.holiday" placeholder="请假天数"></el-input>
      </el-form-item>
      <el-form-item label="请假原因">
        <el-input v-model="leaveForm.cause" placeholder="请假原因"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">提交申请</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: "AskForLeave",
  data() {
    return {
      leaveForm: {
        username: '',
        holiday: '',
        cause:''
      }
    }
  },
  methods: {
    onSubmit() {
      this.axios.post("http://localhost:8083/v2/askForLeave",this.leaveForm).then(resp=>{
        alert(resp.data)
      })
    }
  }
}
</script>

<style scoped>

</style>